<!DOCTYPE html>
<html>
<head>
	<title></title>
	
</head>
<body>
<span class="desc">拍照或从手机相册中选图接口</span>
<button class="btn btn_primary" id="chooseImage">chooseImage</button> 
<span class="desc">拍照或从手机相册中选图接口</span>
<button class="btn btn_primary" id="uploadImage">chooseImage</button>  
</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  <script>
    wx.config({
      debug: false,
      appId: 'wx603db1a9748a186b',
      timestamp: {$signPackage.timestamp},
      nonceStr: '{$signPackage.nonceStr}',
      signature: '{$signPackage.signature}',
      jsApiList: [
        'chooseImage',
        'uploadImage'
      ]
    });

 document.querySelector('#chooseImage').onclick = function () {
    wx.chooseImage({
      success: function (res) {
        images.localId = res.localIds;
        alert('已选择 ' + res.localIds.length + ' 张图片');
      }
    });
  };

  </script>
</html>